<?php

namespace App\Http\Requests\User;

use App\Http\Requests\BaseRequest;

class UserUpdateRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function rules(): array
    {
        return [
            'nickname' => ['required', 'string'],
            // 'mobile' => ['sometimes','nullable','regex:/^1[3-9]\d{9}$/'],
        ];
    }

    public function messages(): array
    {
        return [
            'nickname.required' => '昵称不能为空',
            'nickname.string' => '昵称数据类型有误',
            'mobile.required' => '电话不能为空',
            'mobile.regex' => '电话格式不正确'
        ];
    }
}
